﻿/* $RCSFile: PortalCrmImageModuleControl.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/AddonNice.ImageSettings/UI/WebControls/PortalCrmImageModuleControl.cs $
 * $log$
 * Revision 7 2010/08/09 09:44:02  christian.surieux
 *   Added Log to cs sources files
 */

using System;
using System.Diagnostics;
using System.Data;
using System.Reflection;
using System.ComponentModel;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.Caching;
using System.Text;
using System.Xml;

using AddonNice.UI;
using AddonNice.UI.DataTypes;
using AddonNice.UI.WebControls;
using AddonNice.Helpers;
using AddonNice.Security;
using AddonNice.Configuration;
using AddonNice.Diagnostics;
using AddonNice.Design;

using AddonNice.CRMWrapper;

using AddonNice.CRMImage;

using Trace2    =   System.Diagnostics.Trace;

namespace AddonNice.CRMImage.UI.WebControls
{
/// <summary>
/// The PortalCrmImageModule class inherits from PortalCRMModuleControl.
/// It contains all CRM properties to manage dispay of modules to manage images
/// </summary>
    public class PortalCrmImageModuleControl : PortalCRMModuleControl
    {
		#region license

        private CRMImageManager _ImM;
        
        /// <summary>
        /// Check for ImageManager and AddonNice license
        /// Will be automatically called by PortalModuleControl constructor
        /// </summary>
        protected override bool CheckLicense
        {
            get
            {
                if (_ImM == null)
                    _ImM = new CRMImageManager();
                if (_ImM != null)
                    return ( _ImM.License.IsValid && base.CheckLicense ) ;
                return false;
            }
        }

        /// Check for ImageManager AddonNice license demo mode
        public override bool IsDemo
        {
            get
            {
                if (_ImM == null)
                    _ImM = new CRMImageManager();
                if (_ImM != null)
                    return ( _ImM.DemoMode && base.IsDemo );
                return true;
            }
        }
        #endregion license

        #region module properties override

        public override string Category
		{
			get
			{
                return ImStr.ImageModuleCat;
			}
		}

		public override string CategoryName
		{
			get
			{
                return LocalizeHelper.Localize(ImStr.ResourceFile,ImStr.ResourceItem,ImStr.IMAGE_MOD_CAT,ImStr.ImageModuleCat);
			}
		}

        #endregion module properties override
    }
}
